import { ids, multiple, queryParams, single, tableNames } from "./data";
import { getList } from "./utils";

// 多选框选中数据
function handleSelectionChange(selection) {
    ids.value = selection.map((item) => item.tableId);
    tableNames.value = selection.map((item) => item.tableName);
    single.value = selection.length != 1;
    multiple.value = !selection.length;
}

/** 排序触发事件 */
function handleSortChange(column, prop, order) {
    queryParams.value.orderByColumn = column.prop;
    queryParams.value.isAsc = column.order;
    const res= getList();

}

/** 搜索按钮操作 */
function handleQuery() {
    queryParams.value.pageNum = 1;
    getList();
  }

export {
    handleSelectionChange,
    handleSortChange

}
